-
Notifications
You must be signed in to change notification settings - Fork 142
Resolved multi team similar repo issue #580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only did a shallow review. The team should do a proper review.
@Kamlesh72 Please let me know, once the query changes are done and if possible upload a screen recording for the same. |
@shivam-bit This works fine. .leftJoin({ rw: Table.RepoWorkflow }, function () {
this.on('OrgRepo.id', 'rw.org_repo_id').andOn(
'rw.is_active',
'=',
dbRaw.raw(true)
);
}) Both this code leaves few repos if their RepoWorkflow exists but not active. .leftJoin({ rw: Table.RepoWorkflow }, 'OrgRepo.id', 'rw.org_repo_id')
.andWhere('rw.is_active', true)
.orWhereNull('rw.is_active');
.leftJoin({ rw: Table.RepoWorkflow }, 'OrgRepo.id', 'rw.org_repo_id')
.andWhere(function () {
this.where('rw.is_active', true).orWhereNull('rw.is_active');
}) |
@Kamlesh72 if i am getting this right what you mean is that in the returned repos list there will be few repos missing since they don't have any active workflows. If yes, then that shouldn't be the case |
@shivam-bit Yes. It only returns If there is no workflow in db or is_active is true. I think this will solve it. Will push the code after testing. .leftJoin(
{ rw: Table.RepoWorkflow },
function () {
this.on('OrgRepo.id', 'rw.org_repo_id').andOn(
'rw.is_active',
'tr.is_active'
);
}
); |
@shivam-bit Updated the code. Previous V/s Current: ![]() ![]() |
Will update the Delete team code in morning. |
@shivam-bit Does the delete team queries need to be wrapped in transaction? |
@Kamlesh72 Although we are not using using transaction BFF(next.js api) side yet, but in this case it totally make sense to use it. |
@Kamlesh72 Lets goooooooo!!🚀 |
Linked Issue(s)
If team has a repo, then same repo added to another team is not visible.
Also the method getSelectedReposForOrg is returning deleted teams repo, unnecessarily increasing response size.
Acceptance Criteria fulfillment
Proposed changes (including videos or screenshots)
The db query now directly returns Team repos with multiple workflows.